package com.spzx.user.controller;


import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.user.domain.Region;
import com.spzx.user.service.UserRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/region")
@RestController
public class UserRegionController {

    @Autowired
    private UserRegionService userRegionService;

    @GetMapping("/treeSelect/{parentCode}")
    public AjaxResult treeSelect(@PathVariable("parentCode") String parentCode){
        List<Region> list = userRegionService.treeSelect(parentCode);
        return AjaxResult.success(list);
    }
}
